<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');


/*
  |------------------------------------------------------------------------------
  | list roles don't check
  |------------------------------------------------------------------------------
 */
$config['skip_check_role'] = array('admin');


/*
  |------------------------------------------------------------------------------
  | list modules don't check
  |------------------------------------------------------------------------------
 */
$config['skip_check_module'] = array('default', 'manager', 'ia');


/*
  |------------------------------------------------------------------------------
  | list controllers don't check
  |------------------------------------------------------------------------------
 */
$config['admin']['skip_check_controller'] = array('auth');

/*
  |------------------------------------------------------------------------------
  | session var of user role
  |------------------------------------------------------------------------------
 */
$config['session_rol_var'] = 'role_name';


/*
  |------------------------------------------------------------------------------
  | session var of user id
  |------------------------------------------------------------------------------
 */
$config['session_userid_var'] = 'userid';


/*
  |------------------------------------------------------------------------------
  | default role if don't find session user role
  |------------------------------------------------------------------------------
 */
$config['default_role'] = 'guest';


/*
  |------------------------------------------------------------------------------
  | default backend module
  |------------------------------------------------------------------------------
 */
$config['module_backend'] = 'admin';


/*
  |------------------------------------------------------------------------------
  | page login of admin module
  |------------------------------------------------------------------------------
  |
  | $config[module]['class_login_page'] = array(module,controller,action);
  |
 */
$config['admin']['class_login_page'] = array('admin', 'auth', 'login');


/*
  |------------------------------------------------------------------------------
  | page error of admin module
  |------------------------------------------------------------------------------
  |
  | $config[module]['class_error_page'] =  array(module,controller,action)
  |
 */
$config['admin']['class_error_page'] = array('admin', 'staticpage', 'error_auth');

/*
  |------------------------------------------------------------------------------
  | Config rule ACL
  |------------------------------------------------------------------------------
  |
  | $config[module][rule] = array (
  |          'controller' => array (
  |              array('allow|deny' => array (
  |                  'actions' => array('action1','action2'),
  |                  'users' => ('role1', 'role2')
  |              )),
  |
 */
$config['admin']['rule'] = array(
    'dashboard' => array(
        array('allow' => array(
                'actions' => array('index', 'detail'),
                'users' => array('user')
            )),
    ),
    'users' => array(
        array('allow' => array(
                'actions' => array('*'),
                'users' => array('user')
            )),
    )
);
